from cProfile import label

from django import forms


class LeaveRequestForm(forms.Form):
    student_name = forms.CharField(label='学生姓名', max_length=100)
    teacher_name = forms.CharField(label='导员姓名', max_length=100)
    student_id = forms.CharField(label='学号', max_length=50)

    level_choices = (
        (2024, '2024'),
        (2023, '2023'),
        (2022, '2022'),
        (2021, '2021'),
    )

    level_2_choices = (
        ('01', '01'),
        ('02', '02'),
        ('03', '03'),
        ('04', '04'),
        ('05', '05'),
    )

    level = forms.ChoiceField(label='年级', choices=level_choices)
    level_2 = forms.ChoiceField(label='班级', choices=level_2_choices)

    major = forms.CharField(label='专业', max_length=100)

    # 使用 ChoiceField 来限制是否离校，是否离开本市只能选择"是"或"否"
    YES_NO_CHOICES = [('是', '是'), ('否', '否')]

    if_or_school = forms.ChoiceField(label='是否离校（只填 是/否）', choices=YES_NO_CHOICES)
    if_or_city = forms.ChoiceField(label='是否离开本市', choices=YES_NO_CHOICES)

    leave_request_type = forms.CharField(label='请假类型', max_length=100)
    phone_num = forms.CharField(label='联系电话', max_length=100)

    # 使用 DateField 和 TimeField 来处理日期和时间
    start_time = forms.DateTimeField(label='请假开始时间', widget=forms.DateTimeInput(attrs={'type': 'datetime-local'}))
    end_time = forms.DateTimeField(label='请假结束时间', widget=forms.DateTimeInput(attrs={'type': 'datetime-local'}))

    txt_ = forms.CharField(label='事由说明', max_length=300, widget=forms.Textarea)
    txt_2 = forms.CharField(label='具体去向', max_length=300, widget=forms.Textarea)

    # 审批时间使用 DateTimeField
    time_1 = forms.DateTimeField(label='审批发送时间', widget=forms.DateTimeInput(attrs={'type': 'datetime-local'}))
    time_2 = forms.DateTimeField(label='审批通过时间', widget=forms.DateTimeInput(attrs={'type': 'datetime-local'}))
